
public class Circle {
    double r;
    static double pi=3.14;

    public Circle() {

    }

    public double mianji(){
        return r*r*pi;
    }
    public double zhouchang(){
        return 2*r*pi;
    }
    public void setR(double r){
        if(r<=0){
            this.r=0;
        }else {
            this.r=r;
        }
    }
    public double getR(){

        return r;
    }
}
